# include <cstdio>
#include <ctime>
#define CLK_TCK 100
#include <iostream>
#include <iomanip>
using namespace std;


int main () {
	int sum = 0;
	cin>>sum;
	int ASpeak,AHua,BSpeak,BHua;
	int A = 0,B = 0;
	for(int i = 0 ; i < sum ; ++i) {
		cin>>ASpeak>>AHua>>BSpeak>>BHua;
		if(AHua == ASpeak+BSpeak && BHua != ASpeak+BSpeak) {
			B++;
	//		cout<<"B+1"<<endl;

		} else if(AHua != ASpeak+BSpeak && BHua == ASpeak+BSpeak) {
			A++;
	//		cout<<"A+1"<<endl;
		}
	}
	cout<<A<<" "<<B;
	return 0;
}
